@extends('home.userinfo.userinfo')
@section('uinfo')
<style type="text/css">
 .btn_sign_in{width:270px;height:42px;display:block;background-color:#ff7800;border-radius:3px;text-align:center;line-height:42px;color:#fff;font-size:20px;margin:17px 0 7px;cursor:pointer}
 .btn_sign_in:hover{text-decoration:none;color:#fff;background-color:#f63}
 .register_info_line{padding:17px 0}
 .register_info_line .label{display:inline-block;width:95px;text-align:right;font-size:14px;color:#333}
 label,input,select,textarea,button{vertical-align:middle;outline:0}
 .input{margin-left:10px;width:258px;height:32px;border:1px solid #ddd;border-radius:2px;padding-left:10px;line-height:32px;-webkit-box-shadow:1px 1px 1px #eaeaea inset;-moz-box-shadow:1px 1px 1px #eaeaea inset;-ms-box-shadow:1px 1px 1px #eaeaea inset;-o-box-shadow:1px 1px 1px #eaeaea inset;box-shadow:.5px 1px 1px #eaeaea inset;font-size:18px;font-family:Arial;color:#666}
 input.invalid{border-color:#F60}
 input.focus{border-color:#8297b0}
 .requied_symbol{color:red;margin-right:5px;font-size:14px;font-family:SimSun}
 .name{float:left;font-size:25px;}
 </style>
 <script type="text/javascript" src="/public/home/Scripts/jquery-1.8.3.min.js"></script>
 <div class="right_side">           
    <h3>个人资料</h3>
  
        <div style="width:400px height:95px" >
            <div style="margin-left:80px" >
                <img src="/uploads/users.png" width="90" height="90" />
            </div>
            <div class="name">
            <p>{{session('name')}}</p>
            </div>
            </div>
   
    
    <br>
<!-- 表单内容 -->

   
                        
    <form role="form" action="{{url('home/userinfo/update')}}" method="post" enctype="multipart/form-data" style="margin:0 auto">
                                
                               <p class="register_info_line" id="telline">
                                    <label class="label" for="mobileNum"><span class="requied_symbol">*</span>昵称</label>
                                    <input class="input" name="nickname" type="text" value="{{old('nickname')}}" />
                                    <span class="prompt"></span>
                                </p>
                                
                                <p class="register_info_line" id="telline">
                                    <label class="label" for="mobileNum"><span class="requied_symbol">*</span>年龄</label>
                                    <input class="input" name="age" type="text" value="{{$info->age}}" />
                                    <span class="prompt"></span>
                                 </p>

                                <p class="register_info_line" id="telline">
                                    <label class="label" for="mobileNum"><span class="requied_symbol">*</span>手机号</label>
                                    <input class="input" name="tell" type="text" value="{{$info->tell}}" />
                                    <span class="prompt"></span>
                                 </p>

                                <p class="register_info_line" id="telline">
                                    <label class="label" for="mobileNum"><span class="requied_symbol">*</span>邮箱</label>
                                    <input class="input" name="email" type="text" value="{{$info->email}}" />
                                    <span class="prompt"></span>
                                 </p>
                                 <p class="register_info_line" id="telline">
                                    <label class="label" for="mobileNum"><span class="requied_symbol">*</span>注：</label>
                                    <label style="color:blue">奖金提现之后，姓名、手机号不可修改</label>
                                    <span class="prompt"></span>
                                 </p>
                                <p class="register_info_line" id="telline" >
                                <label class="label" for="mobileNum"><span class="requied_symbol">*</span> 性别: &nbsp;</label>
                                <input type="radio" name="sex" value="{{$info->sex}}" checked>男
                                <input type="radio" name="sex" value="1">女 
                                </p>
                               
                               <p class="register_info_line" id="telline">
                                    <label class="label" for="mobileNum"><span class="requied_symbol">*</span>QQ</label>
                                    <input class="input" name="qq" type="text" value="{{$info->qq}}" />
                                    <span class="prompt"></span>
                                 </p>
                            {{csrf_field()}}
                            <input class="btn_sign_in" id="sign_in_btn_pop" type="submit" value="完善信息">
                        </form>
                   </div>
                   <script type="text/javascript" >
                     //全局变量 标识
                    var CEMAIL = false;
                    var CAGE = false;
                    var CTELL = false;
                    var CQQ = false;

                    //绑定表单提交事件
                    $('form').submit(function(){
                        //触发所有的丧失焦点事件
                        $('input').trigger('blur');

                        //判断所有的字段都检测成功后提交
                        if(CAGE && CTELL && CQQ && CEMAIL){
                            //都成功
                            return true;
                        }
                          //阻止默认行为
                            return false;
                        })

                     //给邮箱绑定丧失焦点事件
                        $('input[name=email]').blur(function(){
                            //获取用户输入的邮箱
                            var email = $(this).val();
                            //声明正则
                            var reg = /^\w+@\w+\.(com|cn|com\.cn|org|net)$/;
                            if(reg.test(email)){
                                //正确
                                $(this).next().html('ok').css('color','green');
                                $(this).css('border','1px solid green');
                                CEMAIL = true;
                            }else{
                                //错误
                                $(this).next().html('邮箱格式不正确').css('color','red');
                                $(this).css('border','1px solid red');
                                CEMAIL = false;
                            }
                        })

                        //给年龄绑定丧失焦点事件
                        $('input[name=age]').blur(function(){
                            //获取用户输入的年龄
                            var age = $(this).val();
                            //声明正则
                            var reg = /^\d+$/;
                            if(reg.test(age)){
                                //正确
                                $(this).next().html('ok').css('color','green');
                                $(this).css('border','1px solid green');
                                CAGE = true;
                            }else{
                                //错误
                                $(this).next().html('年龄不正确').css('color','red');
                                $(this).css('border','1px solid red');
                                CAGE = false;
                            }
                        })

                        //给手机绑定丧失焦点事件
                        $('input[name=tell]').blur(function(){
                            //获取用户输入的年龄
                            var tell = $(this).val();
                            //声明正则
                            var reg = /^1\d{10}$/;
                            if(reg.test(tell)){
                                //正确
                                $(this).next().html('ok').css('color','green');
                                $(this).css('border','1px solid green');
                                CTELL = true;
                            }else{
                                //错误
                                $(this).next().html('手机号不正确').css('color','red');
                                $(this).css('border','1px solid red');
                                CTELL = false;
                            }
                        })

                        //给qq绑定丧失焦点事件
                        $('input[name=qq]').blur(function(){
                            //获取用户输入的年龄
                            var qq = $(this).val();
                            //声明正则
                            var reg = /^\d{7,11}$/;
                            if(reg.test(qq)){
                                //正确
                                $(this).next().html('ok').css('color','green');
                                $(this).css('border','1px solid green');
                                CQQ = true;
                            }else{
                                //错误
                                $(this).next().html('QQ号不正确').css('color','red');
                                $(this).css('border','1px solid red');
                                CQQ = false;
                            }
                        })



                   </script>
@endsection
        <!--右侧.end-->
